//
//  RecommendWorksCell.m
//  Wedding fantastic
//
//  Created by dllo on 15/7/1.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RecommendWorksCell.h"

#define kHeight [UIScreen mainScreen].bounds.size.height
#define kWidth [UIScreen mainScreen].bounds.size.width

@implementation RecommendWorksCell
- (void)dealloc
{
    [_backGroundView release];
    [_picImageView release];
    [_titleLabel release];
    [_merchantLabel release];
    [_like_countLabel release];
    [_collectionImage release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backGroundView = [[UIView alloc] init];
        self.backGroundView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.backGroundView];
        [_backGroundView release];
        
        self.picImageView = [[UIImageView alloc] init];
        [self.backGroundView addSubview:self.picImageView];
        [_picImageView release];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.font = [UIFont systemFontOfSize:16.0];
        [self.backGroundView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.merchantLabel = [[UILabel alloc] init];
        self.merchantLabel.font = [UIFont systemFontOfSize:13.0];
        [self.backGroundView addSubview:self.merchantLabel];
        self.merchantLabel.textColor = [UIColor grayColor];
        [_merchantLabel release];
        
        self.collectionImage = [[UIImageView alloc] init];
        [self.backGroundView addSubview:self.collectionImage];
        self.collectionImage.image = [UIImage imageNamed:@"collection"];
        [_collectionImage release];
        
        self.like_countLabel = [[UILabel alloc] init];
        self.like_countLabel.font = [UIFont systemFontOfSize:13.0];
        [self.backGroundView addSubview:self.like_countLabel];
        self.like_countLabel.textColor = [UIColor grayColor];
        [_like_countLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.backGroundView.frame = CGRectMake(10 * kWidth / 375, 10 * kHeight / 667, self.contentView.frame.size.width - 20 * kWidth / 375, 205 * kHeight / 667);
    
    self.picImageView.frame = CGRectMake(0, 0, self.backGroundView.frame.size.width, 150 * kHeight / 667);
    
    self.titleLabel.frame = CGRectMake(10 * kWidth / 375, 150 * kHeight / 667, 230 * kWidth / 375, 25 * kHeight / 667);
    
    self.merchantLabel.frame = CGRectMake(10 * kWidth / 375, 175 * kHeight / 667, 230 * kWidth / 375, 20 * kHeight / 667);
    
    self.collectionImage.frame = CGRectMake(300 * kWidth / 375, 153 * kHeight / 667, 20 * kWidth / 375, 20 * kHeight / 667);
    
    self.like_countLabel.frame = CGRectMake(325 * kWidth / 375, 152 * kHeight / 667, 30 * kWidth / 375, 25 * kHeight / 667);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
